/**
 * 
 */
package com.lehecai.core.type.sms;

import com.lehecai.core.IntegerBeanLabelItem;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import java.util.ArrayList;
import java.util.List;

/**
 * 短信类型
 * @author leiming
 *
 */
public class SmsType extends IntegerBeanLabelItem {
	private static final long serialVersionUID = 3263255480832149523L;

	private static final Logger logger = LoggerFactory.getLogger(SmsType.class.getName());

	private static List<SmsType> items = new ArrayList<SmsType>();

	protected SmsType(String name, int value) {
		super(SmsType.class.getName(), name, value);
		
		items.add(this);
	}
	
	public static SmsType getItem(int value){
		try {
			return (SmsType) SmsType.getResult(SmsType.class.getName(), value);
		} catch (Exception e) {
			logger.error(e.getMessage(), e);
			return null;
		}
	}
	
	public static List<SmsType> getItems() {
		return items;
	}

    public static final SmsType NORMAL = new SmsType("普通", 0);
    public static final SmsType CODE = new SmsType("验证码", 1);
    public static final SmsType INTERACTION = new SmsType("交互", 2);
    public static final SmsType MARKETING = new SmsType("营销", 3);

}
